<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

	<title>卷云户外-个人信息</title> <jsp:include page="personcommonref.jsp"></jsp:include>
	<script type="text/javascript"
		src="../js/personinfo/jquery.cityselect.js"></script>
</head>

<body id="user">
	<div class="user_cover_bg"></div>
	<!--user box begin-->
	<div class="user_box">

		<%--	公共头部	 --%>
		<jsp:include page="indexHead.jsp"></jsp:include>

		<%--	个人信息公共	begin --%>
		<!--banner begin-->
		<div class="banner_box">
			<img src="../images/user_banner1.jpg" />
		</div>
		<!--banner end-->

		<div class="user_info_box clearfix">
			<div class="user_box_lt">
				<div class="user_box_lt_bg"></div>
				<div class="user_box_lt_cont">
					<div class="user_box_lt_top">
						<div class="user_box_lt_header">
							<img src="${session.user.headImg }">
								<h4>
									${session.user.nickName}
									<c:if test="${session.user.sex==0}">
										<img src="../images/user_focus_g.png">
									</c:if>
									<c:if test="${session.user.sex==1}">
										<img src="../images/user_focus_b.png">
									</c:if>
								</h4>
						</div>

					</div>
					<ul>
						<li class="user_left_current"><a href="personinfo.jsp">我的个人资料</a>
						</li>
						<li><a href="PostAction_personPost.action">我的发帖</a>
						</li>
						<li><a href="personreply.jsp">我的回复</a>
						</li>
						<li><a href="personcollect.jsp">我的收藏</a>
						</li>
						<li><a href="personfocus.jsp">我的关注</a>
						</li>
						<li><a href="personhome.jsp">我的主页</a>
						</li>
					</ul>
				</div>
			</div>
			<link type="text/css" href="../css/personinfo/setup.css"
				rel="stylesheet">
				<script type="text/javascript" src="../js/personinfo/select.js"></script>
				<%--	个人信息公共	end  --%>

				<!-- 非公共  begin  -->
				<div class="user_box_rg">
					<ul class="tab">
						<li class="current"><a href="javascript:;">我的信息</a>
						</li>
						<li><a href="personface.jsp">我的头像</a>
						</li>
						<li><a href="password.jsp">修改密码</a>
						</li>
					</ul>
					<form action="UserAction_updateUserInfo.action" method="post"
						name="/">
						<div class="content">
							<div class="set_con">
								<dl>
									<dt>昵称：</dt>
									<dd>
										<input name="nickName" id="nickName" type="text" class="text"
											value="${session.user.nickName }">
									</dd>
								</dl>
								<dl>
									<dt>性别：</dt>
									<dd>
										<label><input name="sex" type="radio" value="1"
											id="male"><span>男</span>
										</label> <label><input name="sex" type="radio" value="0"
											id="female"><span>女</span>
										</label>
									</dd>
								</dl>
								<dl>
									<dt>手机号码：</dt>
									<dd>
										<input name="phone" type="text" class="text"
											value="${session.user.phone}">
									</dd>
								</dl>
								<dl class="city">
									<dt>所在省份：</dt>
									<dd>
										<div id="city2">
											<select name="provinces" class="prov"
												style="width:110px;height:36px;float:left;font-size: 16px;padding-left: 10px;font-family: 微软雅黑">
												<option value="北京">北京</option>
												<option value="天津">天津</option>
												<option value="河北">河北</option>
												<option value="山西">山西</option>
												<option value="内蒙古">内蒙古</option>
												<option value="辽宁">辽宁</option>
												<option value="吉林">吉林</option>
												<option value="黑龙江">黑龙江</option>
												<option value="上海">上海</option>
												<option value="江苏">江苏</option>
												<option value="浙江">浙江</option>
												<option value="安徽">安徽</option>
												<option value="福建">福建</option>
												<option value="江西">江西</option>
												<option value="山东">山东</option>
												<option value="河南">河南</option>
												<option value="湖北">湖北</option>
												<option value="湖南">湖南</option>
												<option value="广东">广东</option>
												<option value="广西">广西</option>
												<option value="海南">海南</option>
												<option value="重庆">重庆</option>
												<option value="四川">四川</option>
												<option value="贵州">贵州</option>
												<option value="云南">云南</option>
												<option value="西藏">西藏</option>
												<option value="陕西">陕西</option>
												<option value="甘肃">甘肃</option>
												<option value="青海">青海</option>
												<option value="宁夏">宁夏</option>
												<option value="新疆">新疆</option>
												<option value="香港">香港</option>
												<option value="澳门">澳门</option>
												<option value="台湾">台湾</option>
												<option value="国外">国外</option>
											</select>
											<!-- <select name="area" class="city" disabled="disabled" style="margin-left:10px;font-size: 16px;font-family: 微软雅黑"></select> -->
										</div>
									</dd>
								</dl>
								<dl>
									<dt>联系地址：</dt>
									<dd>
										<textarea style="width:610px;height:36px;" name="local"
											id="local"></textarea>
									</dd>
								</dl>
								<dl>
									<dd>
										<input type="hidden" name="id" value="${session.user.id }">
											<input type="hidden" name="status"
											value="${session.user.status }"> <input
												type="hidden" name="registTime"
												value="${session.user.registTime }">
									</dd>
									<dd>
										<input type="submit" value="保存"
											style="padding:0;width:178px;height:36px;background-color: #219BD9;text-align: center;line-height: 36px;color:white;font-size: 16px"
											onclick="return check()" />
									</dd>
								</dl>
							</div>
						</div>
					</form>
				</div>

				<!-- footer end-->
				<script type="text/javascript">
	var flag = false;
	function check(){
		var nickName = jQuery("#nickName").val();
		if(!nickName){
             errmsg = "请输入昵称！";
             layer.open({
				  title: '消息',
				  content: errmsg,
				  icon:0//警告
			}); 
         }else{
         	flag = true;
         }
         return flag;
	}
	
    jQuery(document).ready(function(){
    
    	//jQuery("#city2").citySelect();
    	//更新个人信息的标志
    	var update_flag = '${update_flag}' ;
    	if(update_flag != null && update_flag == "true"){
    		layer.open({
			  title: '消息',
			  content: '保存成功',
			  icon:1
			});  
    	}else if(update_flag != null && update_flag == "false"){
    		layer.open({
			  title: '消息',
			  content: '保存失败',
			  icon:0
			});  
    	}
    	//根据用户性别来动态设值
    	var sex = '${session.user.sex}';
    	if (sex == 1) {
    		jQuery("#male")[0].checked = "checked";
    	}else if (sex == 0) {
    		jQuery("#female")[0].checked = "checked";
    	}
    	
    	//根据select的显示值来为 省份 设值
		var count = jQuery(".prov").get(0).options.length;
		var provinces = '${session.user.provinces}';
		for(var i=0;i<count;i++){
			if(jQuery(".prov").get(0).options[i].text == provinces)  
			{
				jQuery(".prov").get(0).options[i].selected = true;          
				break;  
			}  
		}
		
		//根据select的显示值来为 市 设值
		/* var count2 = jQuery(".city").get(0).options.length;
		for(var i=0;i<count2;i++){
			if(jQuery(".city").get(0).options[i].text == '${session.user.area}')  
			{
				jQuery(".city").get(0).options[i].selected = true;          
				break; 
			}  
		} */
		//为联系地址设值
		jQuery("#local")[0].innerHTML = '${session.user.local}';
		
    });

</script>
				<style>
.set_con dl dd div.selectnav ul li a {
	width: 160px;
}
</style>
		</div>
	</div>
	<!--user box end-->
	<!-- 非公共  end  -->

	<%--	公共底部	 --%>
	<jsp:include page="indexFooter.jsp" />

</body>
</html>
